<c:if test="${sessionBean.ejbSession.owner==null}" >
    <jsp:forward page="../login.jsp" />
</c:if>
<f:view>
    <h:outputText value="Account Settings" style="font-size: 20px; font-weight: bold;"/>
    <h:form>
        <rich:messages globalOnly="true" style="color: red" styleClass="errorMessage"/>
            <h:panelGrid columns="3" >
                <h:outputText value="Email Address:" />
                <h:inputText id="email" value="#{sessionBean.ejbSession.owner.email}" size="30" readonly="true" />
            </h:panelGrid>
            <rich:simpleTogglePanel width="350px" label="Change Email:" switchType="ajax" opened="false" >
                <h:outputText value="If you change your email address, you need to reactivate your Account." />
                <h:panelGrid columns="2" >
                    <h:outputText value="(*) New Email:" />
                    <h:inputText id="email1" maxlength="50" value="#{registerUserBean.email1}" size="30"/>
                
                    <h:outputText value="(*) Re-Type New Email:" />
                    <h:inputText id="email2" maxlength="50" value="#{registerUserBean.email2}" size="30"/>
                </h:panelGrid>
                <h:outputLink value="/site/faces/recoveryPassword.jsp" rendered="#{registerUserBean.linkRPOk}" target="_blank">
                    <h:outputText value="Recovery Password" />
                </h:outputLink>
            </rich:simpleTogglePanel>
            <h:panelGrid columns="2" >
                <%--<h:outputText value="Default Site:" />
                <h:selectOneMenu id="site" value="#{registerUserBean.defaultSiteId}" >
                    <f:selectItem
                            itemValue="0"
                            itemLabel="none"/>
                    <c:forEach var="site" items="#{adminBean.listAll}" >
                        <f:selectItem
                            itemValue="#{site.id}"
                            itemLabel="#{site.site}"/>
                    </c:forEach>
                </h:selectOneMenu>--%>
                
                <h:outputText value="Number of Postings:" />
                <rich:inputNumberSlider id="numberOfPostings" value="#{registerUserBean.numberOfPostings}" width="200" minValue="10" maxValue="50" step="5" enableManualInput="false" showToolTip="false" />
            </h:panelGrid>
            <rich:simpleTogglePanel width="350px" label="Change Password:" switchType="ajax" opened="false">
                <h:panelGrid columns="2" >
                    <h:outputText value="(*) Actual Password:" />
                    <h:inputSecret id="password" value="#{registerUserBean.pwd}" redisplay="false" />
                    
                    <h:outputText value="(*) New Password:" />
                    <h:inputSecret id="password1" value="#{registerUserBean.pwd1}" redisplay="false" />
                
                    <h:outputText value="(*) Re-Type New Password:" />
                    <h:inputSecret id="password2" value="#{registerUserBean.pwd2}" redisplay="false" />
                
                </h:panelGrid>
            </rich:simpleTogglePanel>
        <h:commandButton id="submit" type="submit" value="Update Account" action="#{registerUserBean.updateAccount}" onclick="if(!confirm('If you sure change your settings?'))return false"/>
    </h:form>
    <h:form>
        <h:outputLink value="/site/faces/user/homeUser.jsp" >
            <h:outputText value="Back"></h:outputText>
        </h:outputLink>
    </h:form>
    <rich:separator height="1" />
</f:view>